package com.hw.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.hw.daobean.ProductInfo;
import com.hw.daobean.RelationInfo;
import com.hw.daobean.RelationUpInfo;

import com.hw.dao.ProductInfoDao;
import com.hw.dao.RelationInfoDao;
import com.hw.dao.RelationUpInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig productInfoDaoConfig;
    private final DaoConfig relationInfoDaoConfig;
    private final DaoConfig relationUpInfoDaoConfig;

    private final ProductInfoDao productInfoDao;
    private final RelationInfoDao relationInfoDao;
    private final RelationUpInfoDao relationUpInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        productInfoDaoConfig = daoConfigMap.get(ProductInfoDao.class).clone();
        productInfoDaoConfig.initIdentityScope(type);

        relationInfoDaoConfig = daoConfigMap.get(RelationInfoDao.class).clone();
        relationInfoDaoConfig.initIdentityScope(type);

        relationUpInfoDaoConfig = daoConfigMap.get(RelationUpInfoDao.class).clone();
        relationUpInfoDaoConfig.initIdentityScope(type);

        productInfoDao = new ProductInfoDao(productInfoDaoConfig, this);
        relationInfoDao = new RelationInfoDao(relationInfoDaoConfig, this);
        relationUpInfoDao = new RelationUpInfoDao(relationUpInfoDaoConfig, this);

        registerDao(ProductInfo.class, productInfoDao);
        registerDao(RelationInfo.class, relationInfoDao);
        registerDao(RelationUpInfo.class, relationUpInfoDao);
    }
    
    public void clear() {
        productInfoDaoConfig.clearIdentityScope();
        relationInfoDaoConfig.clearIdentityScope();
        relationUpInfoDaoConfig.clearIdentityScope();
    }

    public ProductInfoDao getProductInfoDao() {
        return productInfoDao;
    }

    public RelationInfoDao getRelationInfoDao() {
        return relationInfoDao;
    }

    public RelationUpInfoDao getRelationUpInfoDao() {
        return relationUpInfoDao;
    }

}
